package br.com.bestOffer.converters;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.FacesConverter;

import br.com.bestOffer.enumerator.Operadora;

@FacesConverter(value="OperadoraConverter")
public class OperadoraConverter implements Converter {

	@Override
	public Object getAsObject(FacesContext arg0, UIComponent arg1, String value) {
		return Enum.valueOf(Operadora.class, value);
	}

	@Override
	public String getAsString(FacesContext arg0, UIComponent arg1, Object value) {
		return value.toString();
	}

}
